/*
 *   The contents of this file are subject to the Mozilla Public License
 *   Version 1.1 (the "License"); you may not use this file except in
 *   compliance with the License. You may obtain a copy of the License at
 *   http://www.mozilla.org/MPL/
 *
 *   Software distributed under the License is distributed on an "AS IS"
 *   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 *   License for the specific language governing rights and limitations
 *   under the License.
 *
 *   The Original Code is Matra - the DTD Parser.
 *
 *   The Initial Developer of the Original Code is Conrad S Roche.
 *   Portions created by Conrad S Roche are Copyright (C) Conrad 
 *   S Roche. All Rights Reserved.
 *
 *   Alternatively, the contents of this file may be used under the terms
 *   of the GNU GENERAL PUBLIC LICENSE Version 2 or any later version
 *   (the  "[GPL] License"), in which case the
 *   provisions of GPL License are applicable instead of those
 *   above.  If you wish to allow use of your version of this file only
 *   under the terms of the GPL License and not to allow others to use
 *   your version of this file under the MPL, indicate your decision by
 *   deleting  the provisions above and replace  them with the notice and
 *   other provisions required by the GPL License.  If you do not delete
 *   the provisions above, a recipient may use your version of this file
 *   under either the MPL or the GPL License."
 *
 *   [NOTE: The text of this Exhibit A may differ slightly from the text of
 *   the notices in the Source Code files of the Original Code. You should
 *   use the text of this Exhibit A rather than the text found in the
 *   Original Code Source Code for Your Modifications.]
 *
 * Created: Conrad S Roche <derupe at users.sourceforge.net>,  14-Aug-2003
 */
package com.conradroche.matra.test.util;

/**
 * Utility class to store the values 
 * for the various Junit tests performed.
 * 
 * @author Conrad Roche
 */
public class DataValues {

	/**
	 * Singleton instance.
	 */
	private static final DataValues _instance = new DataValues();
	
	/**
	 * DataValues Constructor.
	 */
	private DataValues() {
		super();
	}

	/**
	 * Returns the singleton instance of the class.
	 * 
	 * @return The singleton instance.
	 */
	public static DataValues getInstance() {
		return _instance;
	}
	
	/**
	 * Returns the valid whitespace chars.
	 * 
	 * @return The valid whitespace chars.
	 */
	public char[] getSpaceChars() {
		
		final char[] space = {' ', '\n', '\r', '\t'};
		
		return space;
	}
	
	/**
	 * Returns some test attribute names.
	 * @return Test attribute names.
	 */
	public String[] getAttributeNames() {
		
		final String[] names = {"id", "attrName", "xml:lang", "version1"};
		
		return names;
	}
	
	/**
	 * Returns some test NmToken values.
	 * @return Test NmToken values.
	 */
	public String[] getNmTokenValues() {

		//[4]    NameChar    ::=    Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender 
		//[7]    Nmtoken    ::=    (NameChar)+ 
		
		final String[] nmTokens = {"nmtoken", "test1", "abcz", "12qwe", "poi12mnb",
		"a", "1", ".", "-", "_", ":", "0", 
		"12347", "12.56", "-12", "-90.02", "_948", "9_54", 
		"9:45", "3-2", "32-", "9.2-", "32_", "87:",
		"kjgsdf_-.876234:ks", "region:location"};
		
		return nmTokens;
	}
	
	/**
	 * Returns some test name values.
	 * @return Test name values.
	 */
	public String[] getNameValues() {

		//[4]    NameChar    ::=    Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender 
		//[5]    Name    ::=    (Letter | '_' | ':') (NameChar)* 
		final String[] names = {"alpha", "_omega", ":element", "_123", ":987", "l123",
							  "_.", ":.", "_-", ":-", "_", "a", ":",
							  "_.-:1a", ":-._n0"};
							  
		return names;
	}
	
	/**
	 * Returns some test Space String values.
	 * @return Test Space String values.
	 */
	public String[] getSValues() {
		final String[] S = {"", " ", "  ", " \t", "\n", "\n \t", "\t \n", "\n \n", "\t\r\r"};
		
		return S;
	}
}
